Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-native-extra-dimensions-android
Advanced tools
Access additional display metrics on Android devices: status bar height, soft menu bar height, real screen size.
This module allows you to access additional display metrics on Android devices.
There is currently a bug in React Native where Dimensions.get('window').height
sometimes returns
the wrong value.
Also, some apps may want to set the background of status bar and soft menu bar to transparent, thus the top-level view needs to fill up the real screen size.
In android/setting.gradle
...
include ':ExtraDimensions', ':app'
project(':ExtraDimensions').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-extra-dimensions-android/android')
In android/app/build.gradle
...
dependencies {
...
compile project(':ExtraDimensions')
}
Register module (in MainActivity.java)
import ca.jaysoo.extradimensions.ExtraDimensionsPackage; // <--- import
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
......
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReactRootView = new ReactRootView(this);
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new MainReactPackage())
.addPackage(new ExtraDimensionsPackage(this)) // <------ add here
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
mReactRootView.startReactApplication(mReactInstanceManager, "ExampleRN", null);
setContentView(mReactRootView);
}
......
}
Whenever you want to use it within React Native code now you can:
var ExtraDimensions = require('react-native-extra-dimensions-android');
There is only one method get(dimension: string)
that takes in a dimension name, and returns its value as a number
.
Supported dimensions are:
REAL_WINDOW_HEIGHT
- Actual height of screen including system decor elementsREAL_WINDOW_WIDTH
- Actual width of screen including system decor elementsSTATUS_BAR_HEIGHT
- Height of the status barSOFT_MENU_BAR_HEIGHT
- Height of the soft menu bar (supported on most new Android devices)FAQs
Access additional display metrics on Android devices: status bar height, soft menu bar height, real screen size.
The npm package react-native-extra-dimensions-android receives a total of 2,696 weekly downloads. As such, react-native-extra-dimensions-android popularity was classified as popular.
We found that react-native-extra-dimensions-android demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.